evalSafe

open fun evalSafe(vars: Map<Char, Double>, fallback: Double): Double

Evaluates an expression with a fallback. Will fail to fallback instead of throwing. This call is recommended over the 'raw' eval call

Return

Double - The result of the expression evaluation or the fallback if evaluation fails

Author

fzzyhmstrs

Since

0.2.0

Parameters

vars

Map - map of the input variables. The Char used must match the variable characters used in the string expression and visa-versa

fallback

Double - fallback value in case eval() throws